{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'/Users/apple/Desktop/Python 储蓄罐/Untitled Folder/calendar_heatmap.html'"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import random\n",
    "import datetime\n",
    "import pyecharts.options as opts\n",
    "from pyecharts.charts import Calendar\n",
    "def CreateCalendar(Year):\n",
    "    begin = datetime.date(int(Year), 1, 1)\n",
    "    end = datetime.date(int(Year), 7, 31)\n",
    "    data = [\n",
    "        [str(begin + datetime.timedelta(days=i)), random.randint(50, 400)]\n",
    "        for i in range((end - begin).days + 1)\n",
    "    ]\n",
    "    c =  Calendar(init_opts=opts.InitOpts(width=\"650px\", height=\"450px\"))\n",
    "    c.add(\n",
    "        series_name=\"\",\n",
    "        yaxis_data=data,\n",
    "        calendar_opts=opts.CalendarOpts(\n",
    "            pos_top=\"120\",\n",
    "            pos_left=\"30\",\n",
    "            pos_right=\"30\",\n",
    "            range_=[f\"{Year}-01-01\",f'{Year}-07-31'],\n",
    "            yearlabel_opts=opts.CalendarYearLabelOpts(is_show=True),\n",
    "        ),\n",
    "    )\n",
    "    c.set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            title=\"聊天数\", subtitle=f\"{Year}年-wx聊天记录可视化\",\n",
    "            pos_top=\"30\", pos_left=\"center\",\n",
    "            title_textstyle_opts = opts.TextStyleOpts(font_size=\"27\"),\n",
    "            subtitle_textstyle_opts = opts.TextStyleOpts(font_size=\"13\"),\n",
    "            ),\n",
    "        visualmap_opts=opts.VisualMapOpts(\n",
    "            max_=400, min_=50, orient=\"horizontal\", is_piecewise=True,\n",
    "            pos_bottom=\"35%\", pos_left=\"center\"\n",
    "        )\n",
    "    )\n",
    "    return c\n",
    "c1 = CreateCalendar(\"2022\")\n",
    "c1.render(\"calendar_heatmap.html\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pyecharts.charts.basic_charts.calendar.Calendar'>\n"
     ]
    }
   ],
   "source": [
    "print(type(c1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pyecharts.charts.basic_charts.line.Line'>\n"
     ]
    }
   ],
   "source": [
    "print(type(line))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['sans-serif']\n"
     ]
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "print(plt.rcParams[ 'font.family'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/Users/apple/anaconda3/envs/py38/lib/python3.8/site-packages/matplotlib/mpl-data/matplotlibrc\n"
     ]
    }
   ],
   "source": [
    "print(matplotlib.matplotlib_fname())\n",
    "# print(matplotlib.get_cachedir())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Cannot decode configuration file /Users/apple/anaconda3/envs/py38/lib/python3.8/site-packages/matplotlib/mpl-data/matplotlibrc with encoding UTF-8, check LANG and LC_* variables.\n"
     ]
    },
    {
     "ename": "UnicodeDecodeError",
     "evalue": "'utf-8' codec can't decode byte 0xa1 in position 18: invalid start byte",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mUnicodeDecodeError\u001b[0m                        Traceback (most recent call last)",
      "\u001b[1;32m/Users/apple/Desktop/Python 储蓄罐/Untitled Folder/Visualization.ipynb Cell 6\u001b[0m in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> <a href='vscode-notebook-cell:/Users/apple/Desktop/Python%20%E5%82%A8%E8%93%84%E7%BD%90/Untitled%20Folder/Visualization.ipynb#W5sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mmatplotlib\u001b[39;00m\u001b[39m.\u001b[39;00m\u001b[39mfont_manager\u001b[39;00m \u001b[39mimport\u001b[39;00m _rebuild\n\u001b[1;32m      <a href='vscode-notebook-cell:/Users/apple/Desktop/Python%20%E5%82%A8%E8%93%84%E7%BD%90/Untitled%20Folder/Visualization.ipynb#W5sZmlsZQ%3D%3D?line=1'>2</a>\u001b[0m _rebuild()\n",
      "File \u001b[0;32m~/anaconda3/envs/py38/lib/python3.8/site-packages/matplotlib/__init__.py:876\u001b[0m, in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m    870\u001b[0m     \u001b[39mreturn\u001b[39;00m config\n\u001b[1;32m    873\u001b[0m \u001b[39m# When constructing the global instances, we need to perform certain updates\u001b[39;00m\n\u001b[1;32m    874\u001b[0m \u001b[39m# by explicitly calling the superclass (dict.update, dict.items) to avoid\u001b[39;00m\n\u001b[1;32m    875\u001b[0m \u001b[39m# triggering resolution of _auto_backend_sentinel.\u001b[39;00m\n\u001b[0;32m--> 876\u001b[0m rcParamsDefault \u001b[39m=\u001b[39m _rc_params_in_file(\n\u001b[1;32m    877\u001b[0m     cbook\u001b[39m.\u001b[39;49m_get_data_path(\u001b[39m\"\u001b[39;49m\u001b[39mmatplotlibrc\u001b[39;49m\u001b[39m\"\u001b[39;49m),\n\u001b[1;32m    878\u001b[0m     \u001b[39m# Strip leading comment.\u001b[39;49;00m\n\u001b[1;32m    879\u001b[0m     transform\u001b[39m=\u001b[39;49m\u001b[39mlambda\u001b[39;49;00m line: line[\u001b[39m1\u001b[39;49m:] \u001b[39mif\u001b[39;49;00m line\u001b[39m.\u001b[39;49mstartswith(\u001b[39m\"\u001b[39;49m\u001b[39m#\u001b[39;49m\u001b[39m\"\u001b[39;49m) \u001b[39melse\u001b[39;49;00m line,\n\u001b[1;32m    880\u001b[0m     fail_on_error\u001b[39m=\u001b[39;49m\u001b[39mTrue\u001b[39;49;00m)\n\u001b[1;32m    881\u001b[0m \u001b[39mdict\u001b[39m\u001b[39m.\u001b[39mupdate(rcParamsDefault, rcsetup\u001b[39m.\u001b[39m_hardcoded_defaults)\n\u001b[1;32m    882\u001b[0m \u001b[39m# Normally, the default matplotlibrc file contains *no* entry for backend (the\u001b[39;00m\n\u001b[1;32m    883\u001b[0m \u001b[39m# corresponding line starts with ##, not #; we fill on _auto_backend_sentinel\u001b[39;00m\n\u001b[1;32m    884\u001b[0m \u001b[39m# in that case.  However, packagers can set a different default backend\u001b[39;00m\n\u001b[1;32m    885\u001b[0m \u001b[39m# (resulting in a normal `#backend: foo` line) in which case we should *not*\u001b[39;00m\n\u001b[1;32m    886\u001b[0m \u001b[39m# fill in _auto_backend_sentinel.\u001b[39;00m\n",
      "File \u001b[0;32m~/anaconda3/envs/py38/lib/python3.8/site-packages/matplotlib/__init__.py:780\u001b[0m, in \u001b[0;36m_rc_params_in_file\u001b[0;34m(fname, transform, fail_on_error)\u001b[0m\n\u001b[1;32m    778\u001b[0m \u001b[39mwith\u001b[39;00m _open_file_or_url(fname) \u001b[39mas\u001b[39;00m fd:\n\u001b[1;32m    779\u001b[0m     \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 780\u001b[0m         \u001b[39mfor\u001b[39;00m line_no, line \u001b[39min\u001b[39;00m \u001b[39menumerate\u001b[39m(fd, \u001b[39m1\u001b[39m):\n\u001b[1;32m    781\u001b[0m             line \u001b[39m=\u001b[39m transform(line)\n\u001b[1;32m    782\u001b[0m             strippedline \u001b[39m=\u001b[39m line\u001b[39m.\u001b[39msplit(\u001b[39m'\u001b[39m\u001b[39m#\u001b[39m\u001b[39m'\u001b[39m, \u001b[39m1\u001b[39m)[\u001b[39m0\u001b[39m]\u001b[39m.\u001b[39mstrip()\n",
      "File \u001b[0;32m~/anaconda3/envs/py38/lib/python3.8/codecs.py:322\u001b[0m, in \u001b[0;36mBufferedIncrementalDecoder.decode\u001b[0;34m(self, input, final)\u001b[0m\n\u001b[1;32m    319\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mdecode\u001b[39m(\u001b[39mself\u001b[39m, \u001b[39minput\u001b[39m, final\u001b[39m=\u001b[39m\u001b[39mFalse\u001b[39;00m):\n\u001b[1;32m    320\u001b[0m     \u001b[39m# decode input (taking the buffer into account)\u001b[39;00m\n\u001b[1;32m    321\u001b[0m     data \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mbuffer \u001b[39m+\u001b[39m \u001b[39minput\u001b[39m\n\u001b[0;32m--> 322\u001b[0m     (result, consumed) \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_buffer_decode(data, \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49merrors, final)\n\u001b[1;32m    323\u001b[0m     \u001b[39m# keep undecoded input until the next call\u001b[39;00m\n\u001b[1;32m    324\u001b[0m     \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mbuffer \u001b[39m=\u001b[39m data[consumed:]\n",
      "\u001b[0;31mUnicodeDecodeError\u001b[0m: 'utf-8' codec can't decode byte 0xa1 in position 18: invalid start byte"
     ]
    }
   ],
   "source": [
    "from matplotlib.font_manager import _rebuild\n",
    "_rebuild()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "ename": "RuntimeError",
     "evalue": "asyncio.run() cannot be called from a running event loop",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mRuntimeError\u001b[0m                              Traceback (most recent call last)",
      "\u001b[1;32m/Users/apple/Desktop/Python 储蓄罐/Untitled Folder/Visualization.ipynb Cell 7\u001b[0m in \u001b[0;36m<cell line: 24>\u001b[0;34m()\u001b[0m\n\u001b[1;32m     <a href='vscode-notebook-cell:/Users/apple/Desktop/Python%20%E5%82%A8%E8%93%84%E7%BD%90/Untitled%20Folder/Visualization.ipynb#W6sZmlsZQ%3D%3D?line=19'>20</a>\u001b[0m             \u001b[39mreturn\u001b[39;00m \u001b[39mawait\u001b[39;00m response\u001b[39m.\u001b[39mjson()\n\u001b[1;32m     <a href='vscode-notebook-cell:/Users/apple/Desktop/Python%20%E5%82%A8%E8%93%84%E7%BD%90/Untitled%20Folder/Visualization.ipynb#W6sZmlsZQ%3D%3D?line=22'>23</a>\u001b[0m \u001b[39m# 获取官方的数据\u001b[39;00m\n\u001b[0;32m---> <a href='vscode-notebook-cell:/Users/apple/Desktop/Python%20%E5%82%A8%E8%93%84%E7%BD%90/Untitled%20Folder/Visualization.ipynb#W6sZmlsZQ%3D%3D?line=23'>24</a>\u001b[0m data \u001b[39m=\u001b[39m asyncio\u001b[39m.\u001b[39;49mrun(\n\u001b[1;32m     <a href='vscode-notebook-cell:/Users/apple/Desktop/Python%20%E5%82%A8%E8%93%84%E7%BD%90/Untitled%20Folder/Visualization.ipynb#W6sZmlsZQ%3D%3D?line=24'>25</a>\u001b[0m     get_json_data(url\u001b[39m=\u001b[39;49m\u001b[39m\"\u001b[39;49m\u001b[39mhttps://echarts.apache.org/examples/data/asset/data/energy.json\u001b[39;49m\u001b[39m\"\u001b[39;49m)\n\u001b[1;32m     <a href='vscode-notebook-cell:/Users/apple/Desktop/Python%20%E5%82%A8%E8%93%84%E7%BD%90/Untitled%20Folder/Visualization.ipynb#W6sZmlsZQ%3D%3D?line=25'>26</a>\u001b[0m )\n\u001b[1;32m     <a href='vscode-notebook-cell:/Users/apple/Desktop/Python%20%E5%82%A8%E8%93%84%E7%BD%90/Untitled%20Folder/Visualization.ipynb#W6sZmlsZQ%3D%3D?line=27'>28</a>\u001b[0m (\n\u001b[1;32m     <a href='vscode-notebook-cell:/Users/apple/Desktop/Python%20%E5%82%A8%E8%93%84%E7%BD%90/Untitled%20Folder/Visualization.ipynb#W6sZmlsZQ%3D%3D?line=28'>29</a>\u001b[0m     Sankey(init_opts\u001b[39m=\u001b[39mopts\u001b[39m.\u001b[39mInitOpts(width\u001b[39m=\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m1600px\u001b[39m\u001b[39m\"\u001b[39m, height\u001b[39m=\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m800px\u001b[39m\u001b[39m\"\u001b[39m))\n\u001b[1;32m     <a href='vscode-notebook-cell:/Users/apple/Desktop/Python%20%E5%82%A8%E8%93%84%E7%BD%90/Untitled%20Folder/Visualization.ipynb#W6sZmlsZQ%3D%3D?line=29'>30</a>\u001b[0m     \u001b[39m.\u001b[39madd(\n\u001b[0;32m   (...)\u001b[0m\n\u001b[1;32m     <a href='vscode-notebook-cell:/Users/apple/Desktop/Python%20%E5%82%A8%E8%93%84%E7%BD%90/Untitled%20Folder/Visualization.ipynb#W6sZmlsZQ%3D%3D?line=38'>39</a>\u001b[0m     \u001b[39m.\u001b[39mrender(\u001b[39m\"\u001b[39m\u001b[39msankey_diagram.html\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[1;32m     <a href='vscode-notebook-cell:/Users/apple/Desktop/Python%20%E5%82%A8%E8%93%84%E7%BD%90/Untitled%20Folder/Visualization.ipynb#W6sZmlsZQ%3D%3D?line=39'>40</a>\u001b[0m )\n",
      "File \u001b[0;32m~/anaconda3/envs/py38/lib/python3.8/asyncio/runners.py:33\u001b[0m, in \u001b[0;36mrun\u001b[0;34m(main, debug)\u001b[0m\n\u001b[1;32m      9\u001b[0m \u001b[39m\"\"\"Execute the coroutine and return the result.\u001b[39;00m\n\u001b[1;32m     10\u001b[0m \n\u001b[1;32m     11\u001b[0m \u001b[39mThis function runs the passed coroutine, taking care of\u001b[39;00m\n\u001b[0;32m   (...)\u001b[0m\n\u001b[1;32m     30\u001b[0m \u001b[39m    asyncio.run(main())\u001b[39;00m\n\u001b[1;32m     31\u001b[0m \u001b[39m\"\"\"\u001b[39;00m\n\u001b[1;32m     32\u001b[0m \u001b[39mif\u001b[39;00m events\u001b[39m.\u001b[39m_get_running_loop() \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[0;32m---> 33\u001b[0m     \u001b[39mraise\u001b[39;00m \u001b[39mRuntimeError\u001b[39;00m(\n\u001b[1;32m     34\u001b[0m         \u001b[39m\"\u001b[39m\u001b[39masyncio.run() cannot be called from a running event loop\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[1;32m     36\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m coroutines\u001b[39m.\u001b[39miscoroutine(main):\n\u001b[1;32m     37\u001b[0m     \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\u001b[39m\"\u001b[39m\u001b[39ma coroutine was expected, got \u001b[39m\u001b[39m{!r}\u001b[39;00m\u001b[39m\"\u001b[39m\u001b[39m.\u001b[39mformat(main))\n",
      "\u001b[0;31mRuntimeError\u001b[0m: asyncio.run() cannot be called from a running event loop"
     ]
    }
   ],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'/Users/apple/Desktop/Python 储蓄罐/Untitled Folder/sankey_diagram12.html'"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "\n",
    "df1 = pd.read_excel(\"Task 1.xlsx\", sheet_name = \"流入\")\n",
    "df2 = pd.read_excel(\"Task 1.xlsx\", sheet_name = \"流出\")\n",
    "data = {}\n",
    "\n",
    "all_nodes = set(list(df1[\"from\"]))\n",
    "all_nodes |= set(list(df1[\"to\"]))\n",
    "all_nodes |= set(list(df2[\"from\"]))\n",
    "all_nodes |= set(list(df2[\"to\"]))\n",
    "\n",
    "nodes_ = []\n",
    "links_ = []\n",
    "for index, row in df1.iterrows():\n",
    "    if row[\"count\"] > 1:\n",
    "        links_.append({\"source\" : row['from'],\\\n",
    "             \"target\" : row['to'], \"value\" : row[\"count\"]})\n",
    "        nodes_.append( row['from'])\n",
    "        nodes_.append( row['to'])\n",
    "\n",
    "for index, row in df2.iterrows():\n",
    "    if row[\"count\"] > 1:\n",
    "        links_.append({\"source\" : row['from'], \\\n",
    "            \"target\" : row['to'], \"value\" : row[\"value\"]})\n",
    "        nodes_.append( row['from'])\n",
    "        nodes_.append( row['to'])\n",
    "\n",
    "nodes_ = list(set(nodes_))\n",
    "nodes__ = []\n",
    "for i in nodes_:\n",
    "    nodes__.append({'name' : i})\n",
    "\n",
    "data['nodes'] = nodes__\n",
    "data['links'] = links_\n",
    "\n",
    "# ==================== 👆数据处理部分 ========================\n",
    "# ==================== 👇可视化部分 ========================\n",
    "import pyecharts.options as opts\n",
    "from pyecharts.charts import Sankey\n",
    "from pyecharts.commons.utils import JsCode\n",
    "from pyecharts.globals import ThemeType\n",
    "\n",
    "\n",
    "s =    Sankey(init_opts=opts.InitOpts(width=\"800px\",\\\n",
    "     height=\"800px\", bg_color = \"ffffff\",\\\n",
    "     theme=ThemeType.PURPLE_PASSION))\n",
    "s.add(\n",
    "        series_name=\"\",\n",
    "        nodes=data[\"nodes\"],\n",
    "        links=data[\"links\"],\n",
    "        itemstyle_opts=opts.ItemStyleOpts(\n",
    "            border_width=1,\n",
    "            border_color=\"#aaa\"),\n",
    "        linestyle_opt=opts.LineStyleOpts(\n",
    "            color=\"source\", \n",
    "            curve=0.7, \n",
    "            opacity=0.4),\n",
    "        tooltip_opts=opts.TooltipOpts(\n",
    "            # trigger_on=\"mousemove\",\n",
    "            is_show=True,\n",
    "            trigger_on='mousemove|click', formatter=JsCode(\n",
    "                \"\"\"function(params){\n",
    "                    \n",
    "                    return params.data.source + params.data.target;\n",
    "                }\n",
    "                \"\"\")\n",
    "            ),\n",
    "\n",
    "        label_opts=opts.LabelOpts(\n",
    "            position=\"right\",\n",
    "            font_size=20,\n",
    "            # color=\"white\"),\n",
    "        ),\n",
    "    )\n",
    "s.render(\"sankey_diagram12.html\") # 也支持保存为图片\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Bar\n",
    "from pyecharts.commons.utils import JsCode\n",
    "from pyecharts.globals import ThemeType\n",
    "\n",
    "\n",
    "list3 = [\n",
    "    0.0226,\n",
    "    0.0508,\n",
    "    0.0589,\n",
    "    0.0013,\n",
    "    0.0012,\n",
    "    0.0591,\n",
    "    0.0233,\n",
    "    0.0052,\n",
    "    0.0166,\n",
    "    0.1018,\n",
    "    \n",
    "]\n",
    "\n",
    "c = (\n",
    "    Bar(init_opts=opts.InitOpts(bg_color='#ffffff',theme=ThemeType.PURPLE_PASSION))\n",
    "    .add_xaxis([\"🇺🇸US\", \"🇬🇧GB\", \"🇪🇸ES\", \"🇮🇳IN\", \"🇨🇳CN\", \"🇦🇺AU\", \"🇮🇹IT\", \"🇧🇷BR\", \"🇫🇷FR\", \"🇵🇹PT\"])\n",
    "    .add_yaxis(\"博士生数量\", list3, category_gap=\"10%\")\n",
    "    .set_global_opts(\n",
    "        xaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts( font_size=20, color = \"000000\")),\n",
    "        yaxis_opts=opts.AxisOpts(axislabel_opts=opts.LabelOpts(formatter=\"{value} %\", font_size=20, color = \"000000\")),\n",
    "        # title_opts=opts.TitleOpts(title=\"Bar-旋转X轴标签\", subtitle=\"解决标签名字过长的问题\"),\n",
    "    )\n",
    "    # .add_yaxis(\"product2\", list3, stack=\"stack1\", category_gap=\"50%\")\n",
    "    .set_series_opts(\n",
    "        label_opts=opts.LabelOpts(\n",
    "            # position=\"right\",\n",
    "            # formatter=JsCode(\n",
    "            #     \"function(x){return Number(x.data.percent * 100).toFixed() + '%';}\"\n",
    "            # ),\n",
    "            color = \"000000\"\n",
    "        ),\n",
    "        \n",
    "    )\n",
    "    .render(\"stack_bar_percent.html\")\n",
    ")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.8.13 ('py38')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.13"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "da3096a4b2ddf6e3108983d9c4f8ed6b468b54d4f76a60924a980331cf3af984"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
